package dbManager;

import org.hibernate.Session;

/** This class if for connection between DB and class Tag*/
public class TagManager 
{
	private Session session = null;
	
	public TagManager(Session session) 
	{
		if(session == null)
		{
			throw new RuntimeException("Invalid session object.");
		}
		this.session = session;
	}
	
	/**
	 * @param tag is the tag we want insert to DB
	 */
	public void saveTag(Tag tag)
	{
		session.save(tag);
	}
	
	 /**
	  * @param tag is the tag we want to delete from DB
	  */
	public void deleteTag(Tag tag) 
	{
		session.delete(tag);
	}
}